package com.example.mybase.service.impl;

import com.example.mybase.commom.config.data.DataSourceNames;
import com.example.mybase.commom.config.data.annotation.DataSource;
import com.example.mybase.entity.User;
import com.example.mybase.mapper.UserMapper;
import com.example.mybase.service.IUserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class UserServiceImpl implements IUserService {
    @Autowired
    UserMapper userMapper;


    @Override
//    @DataSource(name = "second")
    public User Sel(int id) {
        return userMapper.Sel(id);
    }

    @Override
//    @DataSource(name = "second")
    public User login(String userName, String passWord) {
        return userMapper.login(userName,passWord);
    }

    @Override
//    @DataSource(name = "second")
    public int register(User user) {
        return userMapper.register(user);
    }



}
